import BasePainting from "./BasePainting";
import Effect2D from "../Effect/Effect2D";

export default class BaseAnimationPainting extends BasePainting {

    constructor() {
        super();
        this.effects = [];
    }

    beDrawn(painter) {
        super.beDrawn(painter);
    }

    nextFrame(painter) {
        this.beDrawn(painter);
    }

    nextEffectsFrame(painter) {
        this.effects.forEach(function (effect) {
            if (effect && effect instanceof Effect2D) {
                effect.beDrawn(painter);
            }
        });
    }

    /**
     * @param effects {Array}
     */
    setEffects(effects) {
        this.effects = effects;
    }
}